<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title>数字化面粉车间监测系统</title>
    <script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js"></script>
    <style>
        .head {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background-color: #007bff;
            color: white;
            padding: 10px 20px;
        }

        .mainbox {
            padding: 20px;
        }

        .nav1 {
            list-style: none;
            padding: 0;
            margin: 0;
            display: flex;
            flex-wrap: wrap;
        }

        .nav1 .box {
            padding: 20px;
            border-radius: 8px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .tit {
            font-size: 24px;
            margin-bottom: 20px;
        }

        .yqlist {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
        }

        .yqlist ul {
            display: flex;
            justify-content: space-around;
            width: 100%;
            padding: 0;
        }

        .yqlist li {
            list-style: none;
            text-align: center;
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .yqlist .yq {
            font-size: 18px;
            margin: 60px;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .yqlist .yq span {
            font-size: 20px;
            margin-bottom: 10px;
        }

        .charts-container {
            display: flex;
            justify-content: space-around;
            flex-wrap: wrap;
            width: 100%;
        }

        .chart-box {
            width: 18%;
            height: 300px;
            min-width: 150px;
        }
    </style>
</head>

<body>
    <div class="head clearfix">
        <h1 class="pulll_left">数字化面粉车间监测系统</h1>
        <div class="menu menu2 pulll_left">
            <ul>
                <li><a href="./index.html">数据采集</a></li>
                <li><a href="./control.html">设备控制</a></li>
            </ul>
        </div>
        <div class="time" id="showTime">2024/6/11 15:00:12</div>
    </div>
    <div class="mainbox">
        <ul class="clearfix nav1">
            <li style="width: 70%">
                <div class="box">
                    <div class="tit">数据采集</div>
                    <div class="boxnav" style="height: 330px;">
                        <div class="yqlist">
                            <ul class="clearfix">
                                <li>
                                    <div id="temperature" class="yq">
                                        <img src="images/temp.png" alt="温度">
                                        <span>温度</span>
                                        <div>--</div>
                                    </div>
                                </li>
                                <li>
                                    <div class="yq" id="humidity">
                                        <img src="images/shidu.png" alt="湿度">
                                        <span>湿度</span>
                                        <div>--</div>
                                    </div>
                                </li>
                                <li>
                                    <div class="yq" id="personnelcount">
                                        <img src="images/people.png" alt="人员计数">
                                        <span>人员计数</span>
                                        <div>--</div>
                                    </div>
                                </li>
                                <li>
                                    <div class="yq" id="dustconcentration">
                                        <img src="images/fenc.png" alt="粉尘浓度">
                                        <span>粉尘浓度</span>
                                        <div>--</div>
                                    </div>
                                </li>
                                <li>
                                    <div class="yq" id="pipelinewindpressure">
                                        <img src="images/pipe.png" alt="管道风压">
                                        <span>管道风压</span>
                                        <div>--</div>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </li>
            <li style="width: 30%">
                <div class="box">
                    <div class="tit">视频监控</div>
                    <div class="boxnav" id="video-monitor" style="height: 330px;"></div>
                </div>
            </li>
        </ul>
        <ul class="clearfix nav1">
            <li style="width: 100%">
                <div class="box" style="width: 100%">
                    <div class="tit">历史数据</div>
                    <div class="boxnav" style="height: auto;">
                        <div class="charts-container">
                            <div id="echart1" class="chart-box"></div>
                            <div id="echart2" class="chart-box"></div>
                            <div id="echart3" class="chart-box"></div>
                            <div id="echart4" class="chart-box"></div>
                            <div id="echart5" class="chart-box"></div>
                        </div>
                    </div>
                </div>
            </li>
        </ul>
    </div>

    <script type="text/javascript">
        $(document).ready(function () {
            // 假数据
            var categories = ['2024-06-11 15:00:00', '2024-06-11 15:01:00', '2024-06-11 15:02:00', '2024-06-11 15:03:00', '2024-06-11 15:04:00'];
            var temperatureData = [22, 23, 21, 24, 25];
            var humidityData = [55, 54, 56, 53, 52];
            var personnelData = [5, 6, 5, 7, 6];
            var dustData = [30, 40, 35, 45, 50];
            var windPressureData = [10, 12, 11, 13, 12];

            // 初始化每个图表
            function initChart(chartId, title, data) {
                var chart = echarts.init(document.getElementById(chartId));
                var option = {
                    title: {
                        text: title
                    },
                    tooltip: {
                        trigger: 'axis'
                    },
                    xAxis: {
                        type: 'category',
                        data: categories
                    },
                    yAxis: {
                        type: 'value'
                    },
                    series: [{
                        data: data,
                        type: 'line'
                    }]
                };
                chart.setOption(option);
            }

            initChart('echart1', '温度', temperatureData);
            initChart('echart2', '湿度', humidityData);
            initChart('echart3', '人员计数', personnelData);
            initChart('echart4', '粉尘浓度', dustData);
            initChart('echart5', '管道风压', windPressureData);
        });
    </script>
</body>

</html>
